<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            width: 200px;
            height: 200px;
            background-color: yellowgreen;
        }
    </style>
</head>
<body>
    <div class="ad"></div>
    <script>
        let ad=document.querySelector('.ad')
        ad.addEventListener('click',function () {
            setTimeout(()=>{
                console.log(this)
                this.style.background='pink'
            },2000)
        })

        const arr=[1,6,9,10,100,25]
        const result=arr.filter(function (item) {
            if (item%2==0){
                return true
            } else {
                return false
            }
        })
        console.log(result)

        const res=arr.filter(item=>item%2===0)
        console.log(res)

        // 箭头函数适合与this无关的回调 定时器 数组的方法回调
        // 箭头函数不适合于this有关的回调 事件回调 对象方法
    </script>
</body>
</html>
